package com.sand.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_authority", schema = "ssh_pro", catalog = "")
public class TAuthorityEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private String name;
    private int isMenu;
    private Long parentId;
    private Long menuLevel;
    private String url;

    private String parentIdView;

    public String getParentIdView() {
        return parentIdView;
    }

    public void setParentIdView(String parentIdView) {
        this.parentIdView = parentIdView;
    }

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "isMenu")
    public int getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(int isMenu) {
        this.isMenu = isMenu;
    }

    @Basic
    @Column(name = "parentId")
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "menuLevel")
    public Long getMenuLevel() {
        return menuLevel;
    }

    public void setMenuLevel(Long menuLevel) {
        this.menuLevel = menuLevel;
    }

    @Basic
    @Column(name = "url")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TAuthorityEntity that = (TAuthorityEntity) o;
        return rid == that.rid && isMenu == that.isMenu && Objects.equals(name, that.name) && Objects.equals(parentId, that.parentId) && Objects.equals(menuLevel, that.menuLevel) && Objects.equals(url, that.url);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, name, isMenu, parentId, menuLevel, url);
    }

    @Override
    public String toString() {
        return "TAuthorityEntity{" +
                "rid=" + rid +
                ", name='" + name + '\'' +
                ", isMenu=" + isMenu +
                ", parentId=" + parentId +
                ", menuLevel=" + menuLevel +
                ", url='" + url + '\'' +
                '}';
    }
}
